<?php
namespace app\admin\controller;

use app\BaseController;
use think\facade\View;
use think\facade\Request;
use think\captcha\facade\Captcha;


use app\magicboard\ArticleTmp;
use app\admin\model\Article as Art;
class Index extends Adm
{
    public function index()
    {
    	$c = Art::find(1);
    	//var_dump($c);
    	return View::fetch('index');
    }
    public function console()
    {
        return View::fetch('console');
    }
    public function console1()
    {
        return View::fetch('console1');
    }
    public function login()
    {
        if(Request::isPost()){
            $response = [
                'code'=>-1,
                'msg'=>'登录失败!',
            ];
            return json($response);
        }
        return View::fetch('login');
    }
    public function out()
    {
    	$fields = \app\magicboard\TableInfo::getFields('article','tptest');
    	foreach($fields as $field){
    		var_dump($field);
    		echo 'field:'.$field['COLUMN_NAME'].';type:'.$field['DATA_TYPE'].'<br />';
    		//CHARACTER_MAXIMUM_LENGTH
    	}
    	die;
    }
    public function verify()
    {
        return Captcha::create();
    }
}
